﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Manager.Master" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>
<%@ Import Namespace="B2B.Models" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">



</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="HEAD" runat="server">
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="main_content" runat="server">
    <h5>Home -> Orders Mangement -> Payment</h5>
    <%
        SP_LayDonHang donhang = (SP_LayDonHang)ViewData["donhang"];
        string madonhang = donhang.MaDH.ToString();
        string tensp = donhang.TenSP;
        string email = donhang.Email;
        string sldat = donhang.SlDat.ToString();
        string gia = donhang.Gia.ToString();
        string tongtien = donhang.TongTien.ToString();
        string baogia = donhang.BaoGia;
        string hinhAnh = donhang.HinhAnh;
    %>
    <div id="divThanhToan">
        <form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post" id="payPalForm">
            <input type="hidden" name="item_number" value="01 - Payment for Xman on vutrongvu.com">
            <input type="hidden" name="cmd" value="_xclick">
            <input type="hidden" name="no_note" value="1">
            <input type="hidden" name="business" value="<%=email %>">
        <!--<input type="hidden" name="business" value="a@gmail.com" />-->
            <input type="hidden" name="currency_code" value="USD">
            <input type="hidden" name="return" value="https://www.google.com" />
            
            <table>
                <tr>
                    <th colspan="2">Pyment Order <%=madonhang %></th>
                </tr>
                <tr>
                    <th>Product Name: </th>
                    <td><input name="item_name" type="text" id="item_name" readonly="readonly" size="100px" value="<%=tensp %>"</td>
                </tr>
                <tr>
                    <th>Supplier</th>
                    <td><%=email %></td>
                </tr>
                <tr>
                    <th>File</th>
                    <td><a href="#"><%=baogia %></a></td>
                </tr>
                <tr>
                    <th align="top">Image: </th>
                    <td><img src="../../Images/Alibaba/<%=hinhAnh %>"</td>
                </tr>
                <tr>
                    <th>Quantiy need:</th>
                    <td><%=sldat %></td>
                </tr>
                <tr>
                    <th>Price: </th>
                    <td><%=gia %>VNĐ</td>
                </tr>
                <tr>
                    <th>Amount</th>
                    <td><%=tongtien %>VNĐ</td>
                </tr>
                <tr>
                    <th>Pay: </th>
                    <td><input name="amount" onblur="TienConDu(<%=tongtien %>)" type="text" id="amount" size="45"></td>
                </tr>
                <tr>
                    <th>Residual: </th>
                    <td> <div id="divTienThieu"></div> </td>
                </tr>
                <tr>
                    <td></td>
                    <td><input type="submit" value="Payment" class="btn" /> </td>
                </tr>
            </table>
        </form>
    </div>
    <script type="text/javascript">
        function TienConDu(tongtien) {
            var tientra = $("#amount").val();
            var tienthieu = tongtien - tientra
            $("#divTienThieu").text(tienthieu +" VND");
            
        }
    </script>
</asp:Content>
